<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>已录资料</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css">

    <link rel="stylesheet" href="/static/wx/css/reset.css">
    <link rel="stylesheet" href="/static/wx/css/main.css">
    <link rel="stylesheet" href="/static/wx/css/public_main.css">
</head>

<body>
    <div class="page-group">
        <div class="page page-current" id="dataList">
            <!-- 主内容 -->
            <div class="content">
                <div class="search-bar">
                    <div class="search-box">
                        <img src="/static/wx/imgs/icon/search.png" width="20" id="search-icon">
                        <input type="search" class="search-bar__input" id="searchInput" placeholder="报案号搜索" required="">
                    </div>
                    <div class="search-select">
                        <input readonly="readonly" style="width: 100%;" value="全部" id="selectInput" onchange="getLista()" />
                        <div style="display: none;" class="selectInputDiv">
                            <ul style="list-style: none;margin: 0;padding: 0;text-align: center;">
                                <li value="-1">全部</li>
                                <li value="0">驳回修改</li>
                                <li value="1">未递交审核</li>
                                <li value="2">代录人未递交</li>
                                <li value="3">代录资料未确认</li>
                                <li value="4">待审核</li>
                                <li value="5">被保险人未确认</li>
                                <li value="6">被保险人未委托</li>
                                <li value="7">全部资料已完成</li>
                                <li value="8">拍卖已完成</li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="content-block native-scroll">
                    <div class="list-block" id ='addHtml'>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type='text/javascript' src='/static/wx/lib/sui/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm-extend.min.js' charset='utf-8'></script>
    <script type="text/javascript">
        getList('',-1)
        var typea=-1;
        $(function () {
            $("#selectInput").click(function () {
                //点击输入框打开选项窗，若已打开则关闭
                if ($(".selectInputDiv").css('display') == 'none') {
                    $(".selectInputDiv").show();
                 //   $('.selectInputDiv li:contains(' + $(this).val() + ')').css('background-color', 'orange')
                } else {
                    $(".selectInputDiv").hide();
                }
            })
            $(".selectInputDiv li").click(function () {
                //点击选择时为输入框赋值。并关闭选项窗
                $("#selectInput").val($(this).text())
                $(".selectInputDiv").hide();
                var num= $('#searchInput').val();
                var  type=$(this).val()
                typea=type;
                getList(num,type);
            })
            //为选项设置颜色
            $(".selectInputDiv li").mouseover(function () {
                $('.selectInputDiv li').css('background-color', 'white')
                $(this).css({
                    'cursor': 'pointer',
                    // 'background-color': 'orange'
                });
               })
             });
        $('#searchInput').bind('input propertychange', function() {
           var num= $('#searchInput').val();
            getList(num,typea);

        });
        // function getLista() {
        //     var type= $('#searchInput').val();
        //     console.log(type);
        // }
        function getList(num,type){
            var url="{:url('insurer/getListAjax')}?policy_num="+num+'&type='+type+'&t='+ new Date().getTime()
            $.get(url,function(data,status){
                $('#addHtml').html(data)
            });
        }
    </script>
</body>


</html>